<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="pageContent">
	<form method="post" action="${rootUrl}/member/member/${member.id}" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogAjaxDone);">
		<input type="hidden" name="_method" value="put">
		<div class="pageFormContent" layoutH="56">
	 		<p>
				<label>用户登陆名</label>
				<input  type="text" size="30" value="${member.loginname }" readonly="readonly"/>
			</p>

			<p>
				<label>会员名称或昵称：</label>
				<input  type="text" size="30" value="${member.name }" readonly="readonly"/>
			</p>
			<p>
				<label>真实姓名：</label>
				<input  type="text" size="30" value="${member.truename }" readonly="readonly"/>
			</p>
			<p>
				<label>性别：</label>
				<c:if test="${member.sex == 1}">
				<input  type="text" size="30" value="男" readonly="readonly"/>
				</c:if>
						<c:if test="${member.sex == 2}">
							<input  type="text" size="30" value="女" readonly="readonly"/>
						</c:if>
								<c:if test="${empty member.sex}">
							<input  type="text" size="30" value="未知" readonly="readonly"/>
								</c:if>
			</p>
			<p>
				<label>出生日期：</label>
				<input  type="text" size="30" value="${member.birthday }" readonly="readonly"/>
			</p>
			<p>
				<label>电子邮箱：</label>
				<input  type="text" size="30" value="${member.email }" readonly="readonly"/>
			</p>
			<p>
				<label>手机号：</label>
				<input  type="text" size="30" value="${member.mobile }" readonly="readonly"/>
			</p>
			<p>
				<label>修改手机号：</label>
				<input  type="text" size="30" name="member.mobile"/> 
			</p>
			<p>
				<label>qq：</label>
				<input  type="text" size="30" value="${member.qq }" readonly="readonly"/>
			</p>
			<p>
				<label>微信：</label>
				<input  type="text" size="30" value="${member.weixin }" readonly="readonly"/>
			</p>
			<p>
					<label>用户状态：</label>
				<c:if test="${member.state == 1}">
					<input  type="text" size="30" value="已激活" readonly="readonly"/>
				</c:if>
						<c:if test="${member.state == 0}">
							<input  type="text" size="30" value="未激活" readonly="readonly"/>
						</c:if>
								<c:if test="${empty member.state}">
							<input  type="text" size="30" value="xxxxx" readonly="readonly"/>
								</c:if>
						
			</p>
			<p>
				<label>修改用户状态：</label>
				<select name="member.state">
					<option value="10">      </option>
					<option value="0">未激活</option>
					<option value="1">已激活</option>
				</select>
			</p>
					
			<p>
				<label>注册时间：</label>
				<input  type="text" size="30" value="<fmt:formatDate value="${member.time }" pattern="yyyy-MM-dd HH:mm:ss" />" readonly="readonly"/>
			</p>
			
			<p></p>
			<label> 用户头像:</label>
			<div class="imgContainer">
				<a><img id="qqq" src="${member.avatar }" /></a>
			</div>
	</div>
	
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="passwordReset(${member.id})" >重置登陆密码</button></div></div></li>
				<li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="paypwdReset(${member.account.id});">支付密码重置</button></div></div></li>
				<li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
				
				
					 
			</ul>
		</div>
	</form>
</div>
<script>
function passwordReset(id){
	alertMsg.confirm("确定重置登陆密码?",{
		okCall:function(){ 
			 $.ajax({
				   type: "GET",
				   url: "${rootUrl}/member/member!resetPassword",
				   data: "id="+id,
				   success: function(msg){
					   if(msg.statusCode == 200){
					   	alertMsg.correct( msg.message );
					   }else{
						   alertMsg.error("密码重置失败");
					   }
				   }
				});
		}
	});
}

function paypwdReset(id){
	alertMsg.confirm("确定重置支付密码?",{
		okCall:function(){ 
			 $.ajax({
				   type: "GET",
				   url: "${rootUrl}/member/member!resetPaypwd",
				   data: "id="+id,
				   success: function(msg){
					   if(msg.statusCode == 200){
					   	alertMsg.correct( msg.message );
					   }else{
						   alertMsg.error("密码重置失败");
					   }
				   }
				});
		}
	});
}

</script>